package com.company.handler;

import com.company.Scene;

/**
 * @description:
 * @author: ZhaoYicong
 * @date: Created in 2020/4/27 21:51
 * @version: v1.0
 * @modified By:
 */
public class HandlerGo extends Handler{

    public HandlerGo(Scene scene) {
        super(scene);
    }

    @Override
    public void doCommand(String word) {
        if (word==""){
            System.out.println("请选择你要离开的路线！");
        }else{
            if (word.equals("up")){
                if (scene.getPerson().getFloor_flag()>=Integer.parseInt(scene.getPerson().getNowRoom().getFloor())+1){
                    scene.goRoom(word);
                }else{
                    System.out.println("请先击杀本关boss，不然你不配！");
                }

            }else{

                scene.goRoom(word);
                scene.monsterAttact();
            }
        }



    }
}
